<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/ajax.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<button>点击我发送请求</button>
		<script type="text/javascript">
			
			let btnEle = document.querySelector("button");
			btnEle.onclick = function(){
				ajax({
					url:"index.php",
					// url:"http://localhost:8989/",
					dataType:"json",
					success(res){
						console.log(res);
					}
				})
			}
			
			
			
			
		</script>
	</body>
</html>
